﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Products.aspx.cs" Inherits="Sbook.AdminIstrator.Products1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="~/AdminIstrator/ControlAdmin/MenuLeft.ascx" TagName="MenuLeft"
    TagPrefix="UC" %>
<%@ Register Src="ControlAdmin/ucLogout.ascx" TagName="ucLogout" TagPrefix="uc1" %>
<%@ Register Src="ControlAdmin/MenuTop.ascx" TagName="MenuTop" TagPrefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Admin System</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/ddaccordion.js"></script>
    <script type="text/javascript">
        ddaccordion.init({
            headerclass: "submenuheader", //Shared CSS class name of headers group
            contentclass: "submenu", //Shared CSS class name of contents group
            revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
            mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
            collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
            defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
            onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
            animatedefault: false, //Should contents open by default be animated into view?
            persiststate: true, //persist state of opened contents within browser session?
            toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
            togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
            animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
            oninit: function (headers, expandedindices) { //custom code to run when headers have initalized
                //do nothing
            },
            onopenclose: function (header, index, state, isuseractivated) { //custom code to run whenever a header is opened or closed
                //do nothing
            }
        })
    </script>
    <script src="js/jquery.jclock-1.2.0.js.txt" type="text/javascript"></script>
    <script type="text/javascript" src="js/jconfirmaction.jquery.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('.ask').jConfirmAction();
        });
	
    </script>
    <script type="text/javascript">
        $(function ($) {
            $('.jclock').jclock();
        });
    </script>
    <script language="javascript" type="text/javascript" src="js/niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />
    <link rel="stylesheet" type="text/css" href="css/tcal.css" />
    <script type="text/javascript" src="js/tcal.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="main_container">
        <div class="header">
            <div class="logo">
                <a href="Default.aspx">
                    <img alt="" src="../images/logo_sach.gif" width="130" height="100" />
                </a>
            </div>
            <div class="right_header">
                Welcome Admin, <a href="#">Visit site</a> | <uc1:ucLogout ID="ucLogout1" runat="server" />
            </div>
            <div class="jclock">
            </div>
        </div>
        <div class="main_content">
           <uc1:MenuTop runat="server"></uc1:MenuTop>
            <div class="center_content">
                <UC:MenuLeft runat="server" ID="MenuRight"></UC:MenuLeft>
                <div class="right_content">
                    <h2> LIST PRODUCTS</h2>
                   <br />
                  
                    <br />
                    <asp:Panel runat="server" ID="pnView">
                    <asp:Repeater ID="rpProduct" runat="server"  OnItemCommand="rptProductCommand">
                        <HeaderTemplate>
                            <table id="rounded-corner" summary="2007 Major IT Companies' Profit">
                                <thead>
                                    <tr>
                                       
                                        <th scope="col" class="rounded-company">
                                            Code
                                        </th>
                                        <th scope="col" class="rounded">
                                            Name
                                        </th>
                                        <th scope="col" class="rounded">
                                            Avatar
                                        </th>
                                        <th scope="col" class="rounded">
                                            Price
                                        </th>
                                        <th scope="col" class="rounded">
                                            Sale off
                                        </th>
                                        <th scope="col" class="rounded">
                                            Quantity
                                        </th>
                                        <th scope="col" class="rounded">
                                            Publisher
                                        </th>
                                        <th scope="col" class="rounded">
                                            List
                                        </th>
                                        <th scope="col" class="rounded">
                                            Author
                                        </th>
                                       <%-- <th scope="col" class="rounded">
                                            Status
                                        </th>--%>
                                        <th scope="col" class="rounded">
                                            Edit
                                        </th>
                                        <th scope="col" class="rounded-q4">
                                            Delete
                                        </th>
                                    </tr>
                                </thead>
                                <tfoot>
                                    <tr>
                                        <td colspan="6" class="rounded-foot-left">
                                            <em></em>
                                        </td>
                                        <td class="rounded-foot-right">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </tfoot>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tbody>
                                <tr>
                                    <td>
                                        <%#Eval("PCode")%>
                                    </td>
                                    <td>
                                        <%#Eval("PName")%>
                                    </td>
                                    <td>
                                       <img src=" <%#Eval("PImg")%>" style="width:50px; height:50px" />
                                    </td>
                                    <td>
                                        <%#Eval("PPrice")%>
                                    </td>
                                    <td>
                                        <%#Eval("PSaleOff")%>
                                    </td>
                                    <td>
                                        <%#Eval("PNumber") %>
                                    </td>
                                    <td>
                                        <%#Eval("PUId")%>
                                    </td>
                                    <td>
                                        <%#Eval("CatId")%>
                                    </td>
                                    <td>
                                        <%#Eval("PAuthor")%>
                                    </td>
                                   <%-- <td>
                                        <asp:DropDownList ID="PStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="PStatus_SelectedIndexChanged">
                                            <asp:ListItem Value="0">Ẩn</asp:ListItem>
                                            <asp:ListItem Value="1">Hiện</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:Label ID="lblPStatus" runat="server" Text='<%#Eval("PStatus") %>' Visible="false"> </asp:Label>
                                        <asp:Label ID="lblPId" runat="server" Text='<%#Eval("PId") %>' Visible="false"></asp:Label>
                                    </td>--%>
                                    <td>
                                      
                                        <asp:ImageButton runat="server" ID="imgBtnEdit" ToolTip="Edit" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"PId")%>' CommandName="Edit" ImageUrl="images/user_edit.png" />
                                        
                                    </td>
                                    <td>
                                        <a href="/AdminIstrator/Action/DeleteAction.aspx?p=<%#Eval("PId") %>" class="ask">
                                            <img src="images/trash.png" alt="" title="" border="0" /></a>
                                    </td>
                                </tr>
                            </tbody>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                   
                    <div class="pagination">
                        <%--<p><span class="disabled"><< prev</span><span class="current">1</span><a href="">2</a><a href="">3</a><a href="">4</a><a href="">5</a>…<a href="">10</a><a href="">11</a><a href="">12</a>...<a href="">100</a><a href="">101</a><a href="">next >></a></p>--%>
                        <p>
                            <asp:Literal ID="ltrPaging" runat="server"></asp:Literal></p>
                        <p>
                            &nbsp;</p>
                    </div>
                     <asp:ImageButton runat="server" ID="imgBtnAdd" OnClick="Add_Click" ImageUrl="/images/Capture.PNG" />
                    </asp:Panel>
                    <asp:Panel runat="server" ID="pnUpdate" Visible="false">
                          <table style="float: left">
                            <tr>
                                <th> <asp:Label runat="server" ID="lblMess" ForeColor="Red" Visible="false" Text="Phải nhập đẩy đủ thông tin !"></asp:Label></th>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblPUId" Text="Nhà xuất bản :"></asp:Label>
                                </th>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlPublish">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblCate" Text="Danh mục :"></asp:Label>
                                </th>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlCate">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblPCode" Text="Mã sách :" Visible="false"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtPCode" Visible="false"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblPName" Text="Tên sách :"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtPName" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblImg" Text="Hình ảnh bìa trước :"></asp:Label>
                                </th>
                                <td>
                                    <asp:FileUpload runat="server" ID="filePImg" Width="217px" />
                                    <asp:Label runat="server" ID="lblFile" Visible="true"></asp:Label>
                                    <asp:Image ID="PImgEdit" runat="server" Width="80px" Height="80px" />
                                </td>
                            </tr>
                              <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblImg2" Text="Hình ảnh bìa sau :"></asp:Label>
                                </th>
                                <td>
                                    <asp:FileUpload runat="server" ID="filePImg2" Width="217px" />
                                    <asp:Label runat="server" ID="lblFile2" Visible="true"></asp:Label>
                                    <asp:Image ID="PImg2Edit" runat="server" Width="80px" Height="80px" />
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblPPrice" Text="Giá bán :"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtPPice"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblSaleOff" Text="Giảm giá :"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtSaleOff"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblQuantity" Text="Số lượng :"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtQuantity" Width="50px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblAuthor" Text="Tác giả :"></asp:Label>
                                </th>
                                <td>
                                    <asp:TextBox runat="server" ID="txtAuthor" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblStatus" Text="Hiển thị :" Visible="false"></asp:Label>
                                </th>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlStatus" Visible="false">
                                      
                                        <asp:ListItem Value="1">---Bán chạy---</asp:ListItem>
                                        <asp:ListItem Value="2">---Sách mới xuất bản---</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <asp:Label runat="server" ID="lblPActive" Text="Ẩn/Hiện :"></asp:Label>
                                </th>
                                <td>
                                    <asp:CheckBox runat="server" ID="chkPActive" />
                                </td>
                            </tr>
                            <tr style="margin-top: 20px; float: left">
                                <td align="center" colspan="2" style="float: left">
                                    <asp:Button runat="server" ID="btnSaveB" OnClick="Save_Click" Text="Save" />
                                    <asp:Button runat="server" ID="btnBackB" OnClick="Back_Click" Text="Back" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </div>
                <div class="clear">
            </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
